﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using Visifire.Charts;


namespace Coolzon.UI.Charts.Widgets
{
    public class ChartArea : DataChartAxisBase
    {
        private Visifire.Charts.Chart _chart;
        public ChartArea()
        {
            _chart = new Visifire.Charts.Chart();
            this.Content = _chart;
            DataPointWidth = 1;
        }

        protected override Visifire.Charts.RenderAs GetRender(string dataSeriesId)
        {
            return Visifire.Charts.RenderAs.Area;
        }

        protected override Chart GetChart()
        {
            return _chart;
        }

        protected override IDataPoint ResolveDataPoint()
        {
            return new LightDataPoint();
        }

        protected override void ApplyChartColorPlate()
        {
            if (ColorPlate == null)
                return;

            _chart.Series[0].BorderColor = new System.Windows.Media.SolidColorBrush(Colors.White);
            _chart.Series[0].BorderThickness = new System.Windows.Thickness(1);
            //_chart.Series[0].BorderThickness = new System.Windows.Thickness(1);
            _chart.Series[0].Color = ColorPlate[0];
            //if (_chart.Series != null && _chart.Series.Count > 0)
            //{
            //    if (_chart.Series[0].DataPoints != null)
            //    {
            //        for (int i = 0; i < _chart.Series[0].DataPoints.Count; i++)
            //        {
            //            _chart.Series[0].DataPoints[i] = ColorPlate[0];
            //        }
            //    }
            //}
        }
    }
}
